using B.S.BasicData.EroorCode;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;


namespace B.S.BasicData.Api.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class LoginController : ControllerBase
    {
        private readonly IMediator _mediator;
        public LoginController(IMediator mediator)
        {
            _mediator = mediator;
        }

        [HttpPost]
        public async Task<ActionResult<ApiResult<string>>> Login([FromBody] LoginRequest request)
        {
            var result = await _mediator.Send(request);
            return Ok(result);
        }
    }
} 